package com.liuxinlong.jobs;

import com.liuxinlong.constant.TimeFormatConstants;
import com.liuxinlong.modules.project.service.ProjectService;
import com.liuxinlong.utils.TimeUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 使用quartz框架
 */
@Service
@Slf4j
@Component("syncProjectInfoTask")
public class SyncProjectInfoTask {

    @Autowired
    private ProjectService projectService;

    /**
     * 业务逻辑
     */
    public void reptilian(){
        log.info("SyncProjectInfoTask start...");
        Map<String,Object> param = new HashMap<>();
        String startDate = TimeUtils.getBeforeDay(TimeUtils.getDate(TimeFormatConstants.YYYY_MM_DD),1,TimeFormatConstants.YYYY_MM_DD);
        param.put("startDate",startDate);
//        QuartzTaskLog quartzTaskLog = new QuartzTaskLog();
//        quartzTaskLog.setId(SnowFlake.nextIdStr());
//        quartzTaskLog.setJobId();
//        try {
            projectService.syncProjectInfo(param,1,null);
//        } catch (Exception e) {
//
//        }

    }
}
